// https://leetcode.cn/problems/number-of-1-bits/
// Created by ade on 2022/7/25.
//

class Solution {
public:
    int hammingWeight(uint32_t n) {
        int i = 32;
        int count = 0;
        while(i--){
            if(n&1) count++;
            n >>= 1;
        }
        return count;
    }
};